<!doctype html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no" />
	<title>首页</title>
	<link rel="stylesheet" type="text/css" href="../c/aui.css" />
	<style>
		body {
			background-color: transparent;
			background-color: #000;
		}
	</style>
</head>

<body>
	<div class="aui-btn-block aui-btn aui-btn-danger aui-margin-t-15 aui-margin-b-15" tapmode onclick="wxpay();">微信支付</div>
	<div class="aui-btn-block aui-btn aui-btn-danger aui-margin-t-15 aui-margin-b-15" tapmode onclick="alipay();">支付宝</div>
</body>

<script type="text/javascript" src="../j/api.js"></script>
<script type="text/javascript">
	apiready = function() {
		api.parseTapmode();
	}

	function wxpay() {
		_loading();
		var wxPayPlus = api.require('wxPayPlus');
		_ajax('index/wxpay',function(ret,err){
			_loadingCloes();
			if(ret){
				wxPayPlus.payOrder(ret, function(ret, err) {
				    console.log(JSON.stringify(ret)+JSON.stringify(err))
				});
			}else{
				_alert(JSON.stringify(err))
			}
		})
	}
	function alipay(){
		_loading();
		var aliPayPlus = api.require('aliPayPlus');
		_ajax('index/alipay',function(ret,err){
			_loadingCloes();
			if(ret){
				aliPayPlus.payOrder({
				    orderInfo: ret
				}, function(ret, err) {
				     console.log(JSON.stringify(ret)+JSON.stringify(err))
				});
			}else{
				_alert(JSON.stringify(err))
			}
		})
	}
</script>

</html>
